package com.scpii.universal.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.AppDetailPageTab;
import com.scpii.universal.hibernate.intface.BaseInterface;

public class AppDetailPageTabService implements BaseInterface<AppDetailPageTab> {
	private static final Logger log = LoggerFactory
			.getLogger(AppDetailPageTabService.class);
	
//	private BaseDao<AppDetailPageTab> appDetailPageTabDao = SpringBeanFactory.appDetailPageTabDao;
	private BaseDao<AppDetailPageTab> appDetailPageTabDao;
	public AppDetailPageTab get(Integer id) throws Exception {
		return appDetailPageTabDao.get(id);
	}

	public List<AppDetailPageTab> getAll() throws Exception {
		return appDetailPageTabDao.getAll();
	}

	public AppDetailPageTab get(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public List<AppDetailPageTab> getList(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public Long getTotalCount() throws Exception {
		return null;
	}

	public void save(AppDetailPageTab obj) throws Exception {

	}

	public void update(AppDetailPageTab obj) throws Exception {

	}

	public void delete(AppDetailPageTab obj) throws Exception {

	}

	public void delete(Integer id) throws Exception {

	}

	public List<AppDetailPageTab> hqlGetList(String hql,
			Map<String, Object> argsMap) throws Exception {
		return appDetailPageTabDao.hqlGetList(hql, argsMap);
	}

	public void hqlUpdate(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		appDetailPageTabDao.hqlUpdate(namedHqlQuery, argsMap);
	}

	public Long hqlGetNums(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		return appDetailPageTabDao.hqlGetNums(namedHqlQuery, argsMap);
	}

	public List<AppDetailPageTab> sqlGetList(String sqls,
			Map<String, Object> argsMap) throws Exception {
		return appDetailPageTabDao.sqlGetList(sqls, argsMap);
	}

	public void sqlUpdate(String sqls, Map<String, Object> argsMap)
			throws Exception {
		appDetailPageTabDao.sqlUpdate(sqls, argsMap);
	}

	public Long sqlGetNum(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return appDetailPageTabDao.sqlGetNum(sqls, argsMap);
	}
	
	/**
	 * 根据内容信息获得详情页面信息
	 * @param appId
	 * @param pageId
	 * @return
	 * @throws Exception
	 * @author 甘建新
	 * 2012-7-24下午02:37:24
	 */
	public AppDetailPageTab getAppDetailInfo(int appId,int catelogId)throws Exception{
		if (appId>0 && catelogId>0) {
			Map<String, Object> argsMap = new HashMap<String, Object>();
			argsMap.put("appId", appId);
			argsMap.put("cateId", catelogId);
			List<AppDetailPageTab> appDetailPageList = this.hqlGetList("GET_DETAIL_PAGE_APPID_CATEID", argsMap);
			if (appDetailPageList!=null && appDetailPageList.size()==1) {
				return appDetailPageList.get(0);
			}
		}
		return null;
	}

	//Setter

	public void setAppDetailPageTabDao(BaseDao<AppDetailPageTab> appDetailPageTabDao) {
		this.appDetailPageTabDao = appDetailPageTabDao;
	}
	
}